<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title>
			Ticket To Ride - <ui:insert name="title">Index</ui:insert>
		</title>
		<link href="#{facesContext.externalContext.request.contextPath}/resources/css/default.css" rel="stylesheet" type="text/css" media="screen" />
		<link href="#{facesContext.externalContext.request.contextPath}/resources/css/richfaces.css" rel="stylesheet" type="text/css" media="screen" />
	</head>
	<body>
		<header>
			<ui:insert name="header">
				<h:form id="_formHeader">
				<rich:toolBar rendered="#{sessionBean.loggedIn}">
					<rich:toolBarGroup>
						<rich:dropDownMenu disabled="#{not menuBean.enabled}">
							<f:facet name="label">
								<h:graphicImage url="/resources/images/nouveGnome/16x16/filesystems/gnome-fs-home.png" />
								<h:outputText value="#{messages['label.mainMenu']}"/>
							</f:facet>
							<rich:menuGroup value="#{messages['label.managment']}" icon="/resources/images/nouveGnome/16x16/emblems/emblem-bin.png">
								<rich:menuItem value="#{messages['label.application']}" action="#{applicationBean.start}" rendered="#{sessionBean.inRoleAdministrator or sessionBean.inRoleManager}">
									<f:facet name="icon">
										<h:graphicImage url="/resources/images/nouveGnome/16x16/categories/applications-other.png" />
									</f:facet>
								</rich:menuItem>
								<rich:menuItem value="#{messages['label.certificate']}" action="#{certificateBean.start}" rendered="#{sessionBean.inRoleAdministrator or sessionBean.inRoleManager}">
									<f:facet name="icon">
										<h:graphicImage url="/resources/images/nouveGnome/16x16/emblems/emblem-desktop.png" />
									</f:facet>
								</rich:menuItem>
								<rich:menuItem value="#{messages['label.ticket']}" action="#{ticketBean.start}">
									<f:facet name="icon">
										<h:graphicImage url="/resources/images/nouveGnome/16x16/emblems/emblem-mail.png" />
									</f:facet>
								</rich:menuItem>
								<rich:menuItem value="#{messages['label.user']}" action="#{userBean.start}" rendered="#{sessionBean.inRoleAdministrator}">
									<f:facet name="icon">
										<h:graphicImage url="/resources/images/nouveGnome/16x16/emblems/emblem-people.png" />
									</f:facet>
								</rich:menuItem>
							</rich:menuGroup>
							<rich:menuItem value="#{messages['label.logout']}" action="#{identity.logout}">
								<f:facet name="icon">
									<h:graphicImage url="/resources/images/nouveGnome/16x16/actions/exit.png" />
								</f:facet>
							</rich:menuItem>
						</rich:dropDownMenu>
					</rich:toolBarGroup>
					<rich:toolBarGroup location="right">
						<h:graphicImage url="/resources/images/nouveGnome/16x16/apps/user-info.png" />
						<h:outputText value="#{sessionBean.user.name}" />
					</rich:toolBarGroup>
				</rich:toolBar>
			</h:form>
			</ui:insert>
		</header>
		
		<aside>
			<br />
			<rich:modalPanel id="globalMessagesPopup" width="300" height="200" resizeable="false" moveable="false" showWhenRendered="true" rendered="#{errorBean.messages}">
				<f:facet name="header">
					<h:outputText value="#{messages['label.message']}" />
				</f:facet>
				<f:facet name="controls">
					<h:outputLink value="#" onclick="Richfaces.hideModalPanel('globalMessagesPopup'); return false;">
						<h:graphicImage url="/resources/images/nouveGnome/16x16/actions/exit.png" />
					</h:outputLink>	
				</f:facet>
				<rich:messages layout="table" tooltip="true" showDetail="false" showSummary="true" />
			</rich:modalPanel>
			<ui:insert name="content"></ui:insert>
		</aside>
	
		<footer>
			<ui:insert name="footer">
				<h:form id="formFooter">
					Woodstock Tecnologia
				</h:form>
			</ui:insert>
		</footer>
	</body>
</html>